package com.BlogPark.controller.result;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Auther: MFM
 * @Date: 2022/8/10 - 08 - 10 - 21:56
 * @version: 1.0
 */

@Data
public class Result {
    private Integer code;
    private Object data;
    private String msg;



    public Result() {
    }


    public Result(String msg){
        this.msg=msg;
    }

    public Result(Integer code, Object data) {
        this.data = data;
        this.code = code;
    }

    /**
     * 统一响应Result类
     *
     * @param code 状态码
     * @param data 返回数据
     * @param msg  返回信息
     */
    public Result(Integer code, Object data, String msg) {
        this.data = data;
        this.code = code;
        this.msg = msg;
    }

    public Result(Integer code,String msg) {
        this.code = code;
        this.msg = msg;
    }



    public Integer getCode() {
        return code;
    }


}
